<!doctype html>
<html class="no-js fixed-layout">

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>Amaze UI Admin index Examples</title>
		<meta name="description" content="这是一个 index 页面">
		<meta name="keywords" content="index">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="renderer" content="webkit">
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<link rel="icon" type="image/png" href="assets/i/favicon.png">
		<link rel="apple-touch-icon-precomposed" href="assets/i/app-icon72x72@2x.png">
		<meta name="apple-mobile-web-app-title" content="Amaze UI" />
		<link rel="stylesheet" href="assets/css/amazeui.css" />
		<link rel="stylesheet" href="assets/css/admin.css">
		<link rel="stylesheet" type="text/css" href="assets/css/app.css" />
	</head>

	<body>
		<!--[if lte IE 9]>
<p class="browsehappy">你正在使用<strong>过时</strong>的浏览器，Amaze UI 暂不支持。 请 <a href="http://browsehappy.com/" target="_blank">升级浏览器</a>
  以获得更好的体验！</p>
<![endif]-->

		<header class="am-topbar am-topbar-inverse admin-header">
			<div class="am-topbar-brand">
				<h1>迅腾电力集团售电系统</h1>
			</div>
			<div class="am-collapse am-topbar-collapse" id="topbar-collapse">

			</div>
		</header>

		<div class="am-cf admin-main">
			<!-- sidebar start -->
			<div class="admin-sidebar am-offcanvas" id="admin-offcanvas">
				<div class="am-offcanvas-bar admin-offcanvas-bar">
					<ul class="am-list admin-sidebar-list">
						<li>
							<a href="admin-shoudian.html"><span class="am-icon-home"></span>售电总览</a>
						</li>
						<li>
							<a href="admin-kehu.html"><span class="am-icon-group"></span> 客户关系管理</a>
						</li>
						<li>
							<a href="admin-sdgl.html"><span class="am-icon-flash"></span> 售电管理</a>
						</li>
						<li>
							<a href="admin-hygl.html"><span class="am-icon-copy"></span>合约管理</a>
						</li>
						<li>
							<a href="admin-jygl.html"><span class="am-icon-dollar"></span> 交易管理</a>
						</li>
						<li>
							<a href="admin-jsgl.html"><span class="am-icon-list-alt"></span> 结算管理</a>
						</li>
						<li>
							<a href="#"><span class="am-icon-globe"></span>发电侧协作</a>
						</li>
						<li>
							<a href="admin-fhyc.html"><span class="am-icon-exclamation"></span> 负荷预测</a>
						</li>
						<li>
							<a href="#"><span class="am-icon-calendar-check-o"></span> 决策分析</a>
						</li>
						<li>
							<a href="#"><span class="am-icon-gear"></span>系统管理</a>
						</li>

					</ul>
				</div>
			</div>
			<!-- sidebar end -->

			<!-- content start -->
			<div class="admin-content">
				<div class="admin-content-body">
					<div class="am-padding">
						<div class="am-g">
							<div class="am-u-lg-12">
								<div class="am-panel am-panel-default ">
									<div class="am-panel-hd">
										<h3 class="am-panel-title">关键指标</h3>
									</div>
									<div data-am-widget="titlebar" class="am-titlebar am-titlebar-default">
										<span class="am-titlebar-title"><strong>趋势图</strong></span>
									</div>
									<div class="am-panel-bd">
										<p class="am-text-xl">地域分布</p>
									</div>
									<div id="container">加载地图数据中</div>
									

								</div>
							</div>
						</div>
					</div>

					<!--<div id="container">加载地图数据中</div>-->
				</div>

				<footer class="admin-content-footer">
					<hr>
					<p class="am-padding-left">© 2014 AllMobilize, Inc. Licensed under MIT license.</p>
				</footer>
			</div>
			<!-- content end -->

		</div>

		<a href="#" class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu" data-am-offcanvas="{target: '#admin-offcanvas'}"></a>

		<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="assets/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

		<!--[if (gte IE 9)|!(IE)]><!-->
		<script src="assets/js/jquery.min.js"></script>
		<!--<![endif]-->
		<script src="assets/js/amazeui.min.js"></script>
		<script src="" type="text/javascript" charset="utf-8"></script>
		<script src="assets/js/highmaps.js" type="text/javascript" charset="utf-8"></script>
		<script src="assets/js/app.js" type="text/javascript" charset="utf-8"></script>
		<script src="//img.hcharts.cn/mapdata/maps.js"></script>
		<script type="text/javascript">
			// 动态加载 Script
			function loadScript(url, callback) {
				var script = document.createElement("script");
				script.type = "text/javascript";
				if(script.readyState) { //IE
					script.onreadystatechange = function() {
						if(script.readyState == "loaded" ||
							script.readyState == "complete") {
							script.onreadystatechange = null;
							callback();
						}
					};
				} else { //Others
					script.onload = function() {
						callback();
					};
				}
				script.src = url;
				document.getElementsByTagName("head")[0].appendChild(script);
			}
			/*
			 * 获取链接的 map 参数
			 * map 参数值为地图的路径，所有文件路径参考 https://img.hcharts.cn/mapdata/index.html
			 */
			function getMapName(name) {
				var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"),
					r = window.location.search.substr(1).match(reg),
					defaultMap = {
						path: 'countries/cn/custom/cn-all-sar-taiwan',
						name: 'World, Miller projection, medium resolution',
						chineseName: '世界地图（米勒投影，中分辨率）'
					};
				if(r !== null) {
					var path = unescape(r[2]);
					for(var key in Highcharts.mapsInfo) {
						if(Highcharts.mapsInfo[key][path]) {
							return {
								path: path,
								name: Highcharts.mapsInfo[key][path].name,
								cname: Highcharts.mapsInfo[key][path].chineseName || ''
							};
						}
					}
				}
				return defaultMap;
			}
			// 地图路径，参考 https://img.hcharts.cn/mapdata/index.html
			var map = getMapName('map'),
				url = '//img.hcharts.cn/mapdata/' + map.path + '.js';
			/*
			 * console.log(map)
			 */
			// 动态加载地图数据文件并生成图表。
			loadScript(url, function() {
				// 生成随机数据
				var mapdata = Highcharts.maps[map.path],
					data = [];
				Highcharts.each(mapdata.features, function(md, index) {
					data.push({
						'hc-key': md.properties['hc-key'],
						value: Math.floor((Math.random() * 100) + 1) // 生成 1 ~ 100 随机值
					});
				});
				// 初始化图表
				$('#container').highcharts('Map', {
					title: {
						text: null
					},
					subtitle: {
						text: null
					},
					mapNavigation: {
						enabled: true,
						buttonOptions: {
							verticalAlign: 'bottom'
						}
					},
					colorAxis: {
						min: 0,
						stops: [
							[0, '#EFEFFF'],
							[0.5, Highcharts.getOptions().colors[2]],
							[1, Highcharts.Color(Highcharts.getOptions().colors[2]).brighten(-0.5).get()]
						]
					},
					series: [{
						data: data,
						mapData: mapdata,
						joinBy: 'hc-key',
						name: '随机数据',
						states: {
							hover: {
								color: '#a4edba'
							}
						},
						dataLabels: {
							enabled: false,
							format: '{point.name}'
						}
					}]
				});
			});
		</script>

</html>